﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace comm
{
    public static class Extension
    {
        public static void SortByDistance(this List<world.ObservedResult> results)
        {
            results.Sort(new Comparison<world.ObservedResult>((r1, r2) =>
            {
                if (r1.Distance == r2.Distance)
                {
                    return 0;
                }
                else if (r1.Distance > r2.Distance)
                {
                    return 1;
                }
                else
                {
                    return -1;
                }
            }));
        }
    }
}
